package androidx.recyclerview.widget;

import android.content.Context;
import android.graphics.PointF;
import android.graphics.Rect;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.ViewGroup.MarginLayoutParams;
import android.view.accessibility.AccessibilityEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.recyclerview.widget.RecyclerView.j;
import androidx.recyclerview.widget.RecyclerView.o;
import androidx.recyclerview.widget.RecyclerView.q.c;
import androidx.recyclerview.widget.RecyclerView.t;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.List;
import o.fc;
import o.in;
import o.in$e;
import o.ml;
import o.mq;
import o.mv;

public class StaggeredGridLayoutManager extends j implements c {
    int ʻ = -1;
    int ʼ = Integer.MIN_VALUE;
    LazySpanLookup ʽ = new LazySpanLookup();
    private boolean ˉ;
    @NonNull
    mq ˊ;
    private int ˊˊ;
    private final Rect ˊˋ = new Rect();
    private BitSet ˊॱ;
    private final d ˊᐝ = new d(this);
    boolean ˋ = false;
    private SavedState ˋˊ;
    private int ˋॱ = 2;
    private boolean ˋᐝ = false;
    private int[] ˌ;
    private boolean ˍ = true;
    b[] ˎ;
    private final Runnable ˎˎ = new Runnable(this) {
        final /* synthetic */ StaggeredGridLayoutManager ˊ;

        {
            this.ˊ = r1;
        }

        public void run() {
            this.ˊ.ˎ();
        }
    };
    boolean ˏ = false;
    private int ˏॱ;
    @NonNull
    private final ml ͺ;
    @NonNull
    mq ॱ;
    private boolean ॱˊ;
    private int ॱॱ = -1;
    private int ᐝ;

    public static class LayoutParams extends androidx.recyclerview.widget.RecyclerView.LayoutParams {
        boolean ˊ;
        b ॱ;

        public LayoutParams(Context context, AttributeSet attributeSet) {
            super(context, attributeSet);
        }

        public LayoutParams(int i, int i2) {
            super(i, i2);
        }

        public LayoutParams(MarginLayoutParams marginLayoutParams) {
            super(marginLayoutParams);
        }

        public LayoutParams(android.view.ViewGroup.LayoutParams layoutParams) {
            super(layoutParams);
        }

        public boolean ˏ() {
            return this.ˊ;
        }

        public final int ˊ() {
            if (this.ॱ == null) {
                return -1;
            }
            return this.ॱ.ˏ;
        }
    }

    static class LazySpanLookup {
        int[] ˋ;
        List<FullSpanItem> ˎ;

        static class FullSpanItem implements Parcelable {
            public static final Creator<FullSpanItem> CREATOR = new Creator<FullSpanItem>() {
                public /* synthetic */ Object createFromParcel(Parcel parcel) {
                    return ˋ(parcel);
                }

                public /* synthetic */ Object[] newArray(int i) {
                    return ˎ(i);
                }

                public FullSpanItem ˋ(Parcel parcel) {
                    return new FullSpanItem(parcel);
                }

                public FullSpanItem[] ˎ(int i) {
                    return new FullSpanItem[i];
                }
            };
            boolean ˊ;
            int ˋ;
            int ˎ;
            int[] ˏ;

            FullSpanItem(Parcel parcel) {
                boolean z = true;
                this.ˎ = parcel.readInt();
                this.ˋ = parcel.readInt();
                if (parcel.readInt() != 1) {
                    z = false;
                }
                this.ˊ = z;
                int readInt = parcel.readInt();
                if (readInt > 0) {
                    this.ˏ = new int[readInt];
                    parcel.readIntArray(this.ˏ);
                }
            }

            FullSpanItem() {
            }

            int ˊ(int i) {
                return this.ˏ == null ? 0 : this.ˏ[i];
            }

            public int describeContents() {
                return 0;
            }

            public void writeToParcel(Parcel parcel, int i) {
                parcel.writeInt(this.ˎ);
                parcel.writeInt(this.ˋ);
                parcel.writeInt(this.ˊ ? 1 : 0);
                if (this.ˏ == null || this.ˏ.length <= 0) {
                    parcel.writeInt(0);
                    return;
                }
                parcel.writeInt(this.ˏ.length);
                parcel.writeIntArray(this.ˏ);
            }

            public String toString() {
                return "FullSpanItem{mPosition=" + this.ˎ + ", mGapDir=" + this.ˋ + ", mHasUnwantedGapAfter=" + this.ˊ + ", mGapPerSpan=" + Arrays.toString(this.ˏ) + '}';
            }
        }

        LazySpanLookup() {
        }

        int ˎ(int i) {
            if (this.ˎ != null) {
                for (int size = this.ˎ.size() - 1; size >= 0; size--) {
                    if (((FullSpanItem) this.ˎ.get(size)).ˎ >= i) {
                        this.ˎ.remove(size);
                    }
                }
            }
            return ॱ(i);
        }

        int ॱ(int i) {
            if (this.ˋ == null || i >= this.ˋ.length) {
                return -1;
            }
            int ʼ = ʼ(i);
            if (ʼ == -1) {
                Arrays.fill(this.ˋ, i, this.ˋ.length, -1);
                return this.ˋ.length;
            }
            Arrays.fill(this.ˋ, i, ʼ + 1, -1);
            return ʼ + 1;
        }

        int ˏ(int i) {
            if (this.ˋ == null || i >= this.ˋ.length) {
                return -1;
            }
            return this.ˋ[i];
        }

        void ॱ(int i, b bVar) {
            ˋ(i);
            this.ˋ[i] = bVar.ˏ;
        }

        int ˊ(int i) {
            int length = this.ˋ.length;
            while (length <= i) {
                length *= 2;
            }
            return length;
        }

        void ˋ(int i) {
            if (this.ˋ == null) {
                this.ˋ = new int[(Math.max(i, 10) + 1)];
                Arrays.fill(this.ˋ, -1);
            } else if (i >= this.ˋ.length) {
                Object obj = this.ˋ;
                this.ˋ = new int[ˊ(i)];
                System.arraycopy(obj, 0, this.ˋ, 0, obj.length);
                Arrays.fill(this.ˋ, obj.length, this.ˋ.length, -1);
            }
        }

        void ˏ() {
            if (this.ˋ != null) {
                Arrays.fill(this.ˋ, -1);
            }
            this.ˎ = null;
        }

        void ॱ(int i, int i2) {
            if (this.ˋ != null && i < this.ˋ.length) {
                ˋ(i + i2);
                System.arraycopy(this.ˋ, i + i2, this.ˋ, i, (this.ˋ.length - i) - i2);
                Arrays.fill(this.ˋ, this.ˋ.length - i2, this.ˋ.length, -1);
                ˎ(i, i2);
            }
        }

        private void ˎ(int i, int i2) {
            if (this.ˎ != null) {
                int i3 = i + i2;
                for (int size = this.ˎ.size() - 1; size >= 0; size--) {
                    FullSpanItem fullSpanItem = (FullSpanItem) this.ˎ.get(size);
                    if (fullSpanItem.ˎ >= i) {
                        if (fullSpanItem.ˎ < i3) {
                            this.ˎ.remove(size);
                        } else {
                            fullSpanItem.ˎ -= i2;
                        }
                    }
                }
            }
        }

        void ˏ(int i, int i2) {
            if (this.ˋ != null && i < this.ˋ.length) {
                ˋ(i + i2);
                System.arraycopy(this.ˋ, i, this.ˋ, i + i2, (this.ˋ.length - i) - i2);
                Arrays.fill(this.ˋ, i, i + i2, -1);
                ˊ(i, i2);
            }
        }

        private void ˊ(int i, int i2) {
            if (this.ˎ != null) {
                for (int size = this.ˎ.size() - 1; size >= 0; size--) {
                    FullSpanItem fullSpanItem = (FullSpanItem) this.ˎ.get(size);
                    if (fullSpanItem.ˎ >= i) {
                        fullSpanItem.ˎ += i2;
                    }
                }
            }
        }

        private int ʼ(int i) {
            if (this.ˎ == null) {
                return -1;
            }
            FullSpanItem ᐝ = ᐝ(i);
            if (ᐝ != null) {
                this.ˎ.remove(ᐝ);
            }
            int size = this.ˎ.size();
            int i2 = 0;
            while (i2 < size) {
                if (((FullSpanItem) this.ˎ.get(i2)).ˎ >= i) {
                    break;
                }
                i2++;
            }
            i2 = -1;
            if (i2 == -1) {
                return -1;
            }
            ᐝ = (FullSpanItem) this.ˎ.get(i2);
            this.ˎ.remove(i2);
            return ᐝ.ˎ;
        }

        public void ˋ(FullSpanItem fullSpanItem) {
            if (this.ˎ == null) {
                this.ˎ = new ArrayList();
            }
            int size = this.ˎ.size();
            for (int i = 0; i < size; i++) {
                FullSpanItem fullSpanItem2 = (FullSpanItem) this.ˎ.get(i);
                if (fullSpanItem2.ˎ == fullSpanItem.ˎ) {
                    this.ˎ.remove(i);
                }
                if (fullSpanItem2.ˎ >= fullSpanItem.ˎ) {
                    this.ˎ.add(i, fullSpanItem);
                    return;
                }
            }
            this.ˎ.add(fullSpanItem);
        }

        public FullSpanItem ᐝ(int i) {
            if (this.ˎ == null) {
                return null;
            }
            for (int size = this.ˎ.size() - 1; size >= 0; size--) {
                FullSpanItem fullSpanItem = (FullSpanItem) this.ˎ.get(size);
                if (fullSpanItem.ˎ == i) {
                    return fullSpanItem;
                }
            }
            return null;
        }

        public FullSpanItem ˏ(int i, int i2, int i3, boolean z) {
            if (this.ˎ == null) {
                return null;
            }
            int size = this.ˎ.size();
            for (int i4 = 0; i4 < size; i4++) {
                FullSpanItem fullSpanItem = (FullSpanItem) this.ˎ.get(i4);
                if (fullSpanItem.ˎ >= i2) {
                    return null;
                }
                if (fullSpanItem.ˎ >= i) {
                    if (i3 == 0 || fullSpanItem.ˋ == i3) {
                        return fullSpanItem;
                    }
                    if (z && fullSpanItem.ˊ) {
                        return fullSpanItem;
                    }
                }
            }
            return null;
        }
    }

    @RestrictTo({androidx.annotation.RestrictTo.d.LIBRARY_GROUP})
    public static class SavedState implements Parcelable {
        public static final Creator<SavedState> CREATOR = new Creator<SavedState>() {
            public /* synthetic */ Object createFromParcel(Parcel parcel) {
                return ॱ(parcel);
            }

            public /* synthetic */ Object[] newArray(int i) {
                return ॱ(i);
            }

            public SavedState ॱ(Parcel parcel) {
                return new SavedState(parcel);
            }

            public SavedState[] ॱ(int i) {
                return new SavedState[i];
            }
        };
        boolean ʻ;
        List<FullSpanItem> ʼ;
        int[] ʽ;
        int ˊ;
        int ˋ;
        int ˎ;
        int[] ˏ;
        int ॱ;
        boolean ॱॱ;
        boolean ᐝ;

        SavedState(Parcel parcel) {
            boolean z;
            boolean z2 = true;
            this.ˊ = parcel.readInt();
            this.ˎ = parcel.readInt();
            this.ॱ = parcel.readInt();
            if (this.ॱ > 0) {
                this.ˏ = new int[this.ॱ];
                parcel.readIntArray(this.ˏ);
            }
            this.ˋ = parcel.readInt();
            if (this.ˋ > 0) {
                this.ʽ = new int[this.ˋ];
                parcel.readIntArray(this.ʽ);
            }
            this.ᐝ = parcel.readInt() == 1;
            if (parcel.readInt() == 1) {
                z = true;
            } else {
                z = false;
            }
            this.ʻ = z;
            if (parcel.readInt() != 1) {
                z2 = false;
            }
            this.ॱॱ = z2;
            this.ʼ = parcel.readArrayList(FullSpanItem.class.getClassLoader());
        }

        public SavedState(SavedState savedState) {
            this.ॱ = savedState.ॱ;
            this.ˊ = savedState.ˊ;
            this.ˎ = savedState.ˎ;
            this.ˏ = savedState.ˏ;
            this.ˋ = savedState.ˋ;
            this.ʽ = savedState.ʽ;
            this.ᐝ = savedState.ᐝ;
            this.ʻ = savedState.ʻ;
            this.ॱॱ = savedState.ॱॱ;
            this.ʼ = savedState.ʼ;
        }

        void ˎ() {
            this.ˏ = null;
            this.ॱ = 0;
            this.ˋ = 0;
            this.ʽ = null;
            this.ʼ = null;
        }

        void ˋ() {
            this.ˏ = null;
            this.ॱ = 0;
            this.ˊ = -1;
            this.ˎ = -1;
        }

        public int describeContents() {
            return 0;
        }

        public void writeToParcel(Parcel parcel, int i) {
            int i2;
            int i3 = 1;
            parcel.writeInt(this.ˊ);
            parcel.writeInt(this.ˎ);
            parcel.writeInt(this.ॱ);
            if (this.ॱ > 0) {
                parcel.writeIntArray(this.ˏ);
            }
            parcel.writeInt(this.ˋ);
            if (this.ˋ > 0) {
                parcel.writeIntArray(this.ʽ);
            }
            if (this.ᐝ) {
                i2 = 1;
            } else {
                i2 = 0;
            }
            parcel.writeInt(i2);
            if (this.ʻ) {
                i2 = 1;
            } else {
                i2 = 0;
            }
            parcel.writeInt(i2);
            if (!this.ॱॱ) {
                i3 = 0;
            }
            parcel.writeInt(i3);
            parcel.writeList(this.ʼ);
        }
    }

    class b {
        final /* synthetic */ StaggeredGridLayoutManager ʻ;
        int ˊ = 0;
        int ˋ = Integer.MIN_VALUE;
        int ˎ = Integer.MIN_VALUE;
        final int ˏ;
        ArrayList<View> ॱ = new ArrayList();

        b(StaggeredGridLayoutManager staggeredGridLayoutManager, int i) {
            this.ʻ = staggeredGridLayoutManager;
            this.ˏ = i;
        }

        int ˏ(int i) {
            if (this.ˎ != Integer.MIN_VALUE) {
                return this.ˎ;
            }
            if (this.ॱ.size() == 0) {
                return i;
            }
            ˏ();
            return this.ˎ;
        }

        void ˏ() {
            View view = (View) this.ॱ.get(0);
            LayoutParams ˎ = ˎ(view);
            this.ˎ = this.ʻ.ˊ.ˋ(view);
            if (ˎ.ˊ) {
                FullSpanItem ᐝ = this.ʻ.ʽ.ᐝ(ˎ.ʻ());
                if (ᐝ != null && ᐝ.ˋ == -1) {
                    this.ˎ -= ᐝ.ˊ(this.ˏ);
                }
            }
        }

        int ˊ() {
            if (this.ˎ != Integer.MIN_VALUE) {
                return this.ˎ;
            }
            ˏ();
            return this.ˎ;
        }

        int ˊ(int i) {
            if (this.ˋ != Integer.MIN_VALUE) {
                return this.ˋ;
            }
            if (this.ॱ.size() == 0) {
                return i;
            }
            ˋ();
            return this.ˋ;
        }

        void ˋ() {
            View view = (View) this.ॱ.get(this.ॱ.size() - 1);
            LayoutParams ˎ = ˎ(view);
            this.ˋ = this.ʻ.ˊ.ॱ(view);
            if (ˎ.ˊ) {
                FullSpanItem ᐝ = this.ʻ.ʽ.ᐝ(ˎ.ʻ());
                if (ᐝ != null && ᐝ.ˋ == 1) {
                    this.ˋ = ᐝ.ˊ(this.ˏ) + this.ˋ;
                }
            }
        }

        int ॱ() {
            if (this.ˋ != Integer.MIN_VALUE) {
                return this.ˋ;
            }
            ˋ();
            return this.ˋ;
        }

        void ॱ(View view) {
            LayoutParams ˎ = ˎ(view);
            ˎ.ॱ = this;
            this.ॱ.add(0, view);
            this.ˎ = Integer.MIN_VALUE;
            if (this.ॱ.size() == 1) {
                this.ˋ = Integer.MIN_VALUE;
            }
            if (ˎ.ॱ() || ˎ.ˎ()) {
                this.ˊ += this.ʻ.ˊ.ˊ(view);
            }
        }

        void ˊ(View view) {
            LayoutParams ˎ = ˎ(view);
            ˎ.ॱ = this;
            this.ॱ.add(view);
            this.ˋ = Integer.MIN_VALUE;
            if (this.ॱ.size() == 1) {
                this.ˎ = Integer.MIN_VALUE;
            }
            if (ˎ.ॱ() || ˎ.ˎ()) {
                this.ˊ += this.ʻ.ˊ.ˊ(view);
            }
        }

        void ˊ(boolean z, int i) {
            int ˊ;
            if (z) {
                ˊ = ˊ(Integer.MIN_VALUE);
            } else {
                ˊ = ˏ(Integer.MIN_VALUE);
            }
            ˎ();
            if (ˊ != Integer.MIN_VALUE) {
                if (z && ˊ < this.ʻ.ˊ.ˊ()) {
                    return;
                }
                if (z || ˊ <= this.ʻ.ˊ.ˏ()) {
                    if (i != Integer.MIN_VALUE) {
                        ˊ += i;
                    }
                    this.ˋ = ˊ;
                    this.ˎ = ˊ;
                }
            }
        }

        void ˎ() {
            this.ॱ.clear();
            ॱॱ();
            this.ˊ = 0;
        }

        void ॱॱ() {
            this.ˎ = Integer.MIN_VALUE;
            this.ˋ = Integer.MIN_VALUE;
        }

        void ˋ(int i) {
            this.ˎ = i;
            this.ˋ = i;
        }

        void ʻ() {
            int size = this.ॱ.size();
            View view = (View) this.ॱ.remove(size - 1);
            LayoutParams ˎ = ˎ(view);
            ˎ.ॱ = null;
            if (ˎ.ॱ() || ˎ.ˎ()) {
                this.ˊ -= this.ʻ.ˊ.ˊ(view);
            }
            if (size == 1) {
                this.ˎ = Integer.MIN_VALUE;
            }
            this.ˋ = Integer.MIN_VALUE;
        }

        void ᐝ() {
            View view = (View) this.ॱ.remove(0);
            LayoutParams ˎ = ˎ(view);
            ˎ.ॱ = null;
            if (this.ॱ.size() == 0) {
                this.ˋ = Integer.MIN_VALUE;
            }
            if (ˎ.ॱ() || ˎ.ˎ()) {
                this.ˊ -= this.ʻ.ˊ.ˊ(view);
            }
            this.ˎ = Integer.MIN_VALUE;
        }

        public int ʽ() {
            return this.ˊ;
        }

        LayoutParams ˎ(View view) {
            return (LayoutParams) view.getLayoutParams();
        }

        void ॱ(int i) {
            if (this.ˎ != Integer.MIN_VALUE) {
                this.ˎ += i;
            }
            if (this.ˋ != Integer.MIN_VALUE) {
                this.ˋ += i;
            }
        }

        public int ʼ() {
            if (this.ʻ.ˋ) {
                return ˋ(this.ॱ.size() - 1, -1, true);
            }
            return ˋ(0, this.ॱ.size(), true);
        }

        public int ˋॱ() {
            if (this.ʻ.ˋ) {
                return ˋ(0, this.ॱ.size(), true);
            }
            return ˋ(this.ॱ.size() - 1, -1, true);
        }

        int ˊ(int i, int i2, boolean z, boolean z2, boolean z3) {
            int ˏ = this.ʻ.ˊ.ˏ();
            int ˊ = this.ʻ.ˊ.ˊ();
            int i3 = i2 > i ? 1 : -1;
            while (i != i2) {
                Object obj;
                View view = (View) this.ॱ.get(i);
                int ˋ = this.ʻ.ˊ.ˋ(view);
                int ॱ = this.ʻ.ˊ.ॱ(view);
                if (z3) {
                    obj = ˋ <= ˊ ? 1 : null;
                } else if (ˋ < ˊ) {
                    int i4 = 1;
                } else {
                    obj = null;
                }
                Object obj2 = z3 ? ॱ >= ˏ ? 1 : null : ॱ > ˏ ? 1 : null;
                if (!(obj == null || r2 == null)) {
                    if (z && z2) {
                        if (ˋ >= ˏ && ॱ <= ˊ) {
                            return this.ʻ.ˎ(view);
                        }
                    } else if (z2) {
                        return this.ʻ.ˎ(view);
                    } else {
                        if (ˋ < ˏ || ॱ > ˊ) {
                            return this.ʻ.ˎ(view);
                        }
                    }
                }
                i += i3;
            }
            return -1;
        }

        int ˋ(int i, int i2, boolean z) {
            return ˊ(i, i2, false, false, z);
        }

        public View ˊ(int i, int i2) {
            View view = null;
            int i3;
            View view2;
            if (i2 == -1) {
                int size = this.ॱ.size();
                i3 = 0;
                while (i3 < size) {
                    view2 = (View) this.ॱ.get(i3);
                    if ((this.ʻ.ˋ && this.ʻ.ˎ(view2) <= i) || ((!this.ʻ.ˋ && this.ʻ.ˎ(view2) >= i) || !view2.hasFocusable())) {
                        break;
                    }
                    i3++;
                    view = view2;
                }
                return view;
            }
            i3 = this.ॱ.size() - 1;
            while (i3 >= 0) {
                view2 = (View) this.ॱ.get(i3);
                if (this.ʻ.ˋ && this.ʻ.ˎ(view2) >= i) {
                    break;
                } else if (this.ʻ.ˋ || this.ʻ.ˎ(view2) > i) {
                    if (!view2.hasFocusable()) {
                        break;
                    }
                    i3--;
                    view = view2;
                } else {
                    return view;
                }
            }
            return view;
        }
    }

    class d {
        int[] ʽ;
        boolean ˊ;
        int ˋ;
        boolean ˎ;
        int ˏ;
        boolean ॱ;
        final /* synthetic */ StaggeredGridLayoutManager ॱॱ;

        d(StaggeredGridLayoutManager staggeredGridLayoutManager) {
            this.ॱॱ = staggeredGridLayoutManager;
            ˎ();
        }

        void ˎ() {
            this.ˏ = -1;
            this.ˋ = Integer.MIN_VALUE;
            this.ˎ = false;
            this.ˊ = false;
            this.ॱ = false;
            if (this.ʽ != null) {
                Arrays.fill(this.ʽ, -1);
            }
        }

        void ॱ(b[] bVarArr) {
            int length = bVarArr.length;
            if (this.ʽ == null || this.ʽ.length < length) {
                this.ʽ = new int[this.ॱॱ.ˎ.length];
            }
            for (int i = 0; i < length; i++) {
                this.ʽ[i] = bVarArr[i].ˏ(Integer.MIN_VALUE);
            }
        }

        void ˊ() {
            int ˊ;
            if (this.ˎ) {
                ˊ = this.ॱॱ.ˊ.ˊ();
            } else {
                ˊ = this.ॱॱ.ˊ.ˏ();
            }
            this.ˋ = ˊ;
        }

        void ˎ(int i) {
            if (this.ˎ) {
                this.ˋ = this.ॱॱ.ˊ.ˊ() - i;
            } else {
                this.ˋ = this.ॱॱ.ˊ.ˏ() + i;
            }
        }
    }

    public StaggeredGridLayoutManager(Context context, AttributeSet attributeSet, int i, int i2) {
        RecyclerView$j$a ॱ = ॱ(context, attributeSet, i, i2);
        ˊ(ॱ.ˋ);
        ॱ(ॱ.ॱ);
        ˎ(ॱ.ˊ);
        this.ͺ = new ml();
        ॱˎ();
    }

    public boolean ˋ() {
        return this.ˋॱ != 0;
    }

    private void ॱˎ() {
        this.ˊ = mq.ˊ(this, this.ᐝ);
        this.ॱ = mq.ˊ(this, 1 - this.ᐝ);
    }

    boolean ˎ() {
        if (ˈ() == 0 || this.ˋॱ == 0 || !ᐝॱ()) {
            return false;
        }
        int ˋॱ;
        int ʻॱ;
        if (this.ˏ) {
            ˋॱ = ˋॱ();
            ʻॱ = ʻॱ();
        } else {
            ˋॱ = ʻॱ();
            ʻॱ = ˋॱ();
        }
        if (ˋॱ == 0 && ॱॱ() != null) {
            this.ʽ.ˏ();
            ˑ();
            ॱˋ();
            return true;
        } else if (!this.ˋᐝ) {
            return false;
        } else {
            int i = this.ˏ ? -1 : 1;
            FullSpanItem ˏ = this.ʽ.ˏ(ˋॱ, ʻॱ + 1, i, true);
            if (ˏ == null) {
                this.ˋᐝ = false;
                this.ʽ.ˎ(ʻॱ + 1);
                return false;
            }
            FullSpanItem ˏ2 = this.ʽ.ˏ(ˋॱ, ˏ.ˎ, i * -1, true);
            if (ˏ2 == null) {
                this.ʽ.ˎ(ˏ.ˎ);
            } else {
                this.ʽ.ˎ(ˏ2.ˎ + 1);
            }
            ˑ();
            ॱˋ();
            return true;
        }
    }

    public void ˊॱ(int i) {
        if (i == 0) {
            ˎ();
        }
    }

    public void ˊ(RecyclerView recyclerView, o oVar) {
        super.ˊ(recyclerView, oVar);
        ˎ(this.ˎˎ);
        for (int i = 0; i < this.ॱॱ; i++) {
            this.ˎ[i].ˎ();
        }
        recyclerView.requestLayout();
    }

    View ॱॱ() {
        int i;
        int i2;
        int ˈ = ˈ() - 1;
        BitSet bitSet = new BitSet(this.ॱॱ);
        bitSet.set(0, this.ॱॱ, true);
        boolean z = (this.ᐝ == 1 && ʽ()) ? true : true;
        if (this.ˏ) {
            i = -1;
        } else {
            i = ˈ + 1;
            ˈ = 0;
        }
        if (ˈ < i) {
            i2 = 1;
        } else {
            i2 = -1;
        }
        int i3 = ˈ;
        while (i3 != i) {
            View ᐝ = ᐝ(i3);
            LayoutParams layoutParams = (LayoutParams) ᐝ.getLayoutParams();
            if (bitSet.get(layoutParams.ॱ.ˏ)) {
                if (ˋ(layoutParams.ॱ)) {
                    return ᐝ;
                }
                bitSet.clear(layoutParams.ॱ.ˏ);
            }
            if (!(layoutParams.ˊ || i3 + i2 == i)) {
                boolean z2;
                View ᐝ2 = ᐝ(i3 + i2);
                int ॱ;
                if (this.ˏ) {
                    ˈ = this.ˊ.ॱ(ᐝ);
                    ॱ = this.ˊ.ॱ(ᐝ2);
                    if (ˈ < ॱ) {
                        return ᐝ;
                    }
                    if (ˈ == ॱ) {
                        z2 = true;
                    }
                    z2 = false;
                } else {
                    ˈ = this.ˊ.ˋ(ᐝ);
                    ॱ = this.ˊ.ˋ(ᐝ2);
                    if (ˈ > ॱ) {
                        return ᐝ;
                    }
                    if (ˈ == ॱ) {
                        z2 = true;
                    }
                    z2 = false;
                }
                if (z2) {
                    if (layoutParams.ॱ.ˏ - ((LayoutParams) ᐝ2.getLayoutParams()).ॱ.ˏ < 0) {
                        z2 = true;
                    } else {
                        z2 = false;
                    }
                    if (z2 != (z >= false)) {
                        return ᐝ;
                    }
                } else {
                    continue;
                }
            }
            i3 += i2;
        }
        return null;
    }

    private boolean ˋ(b bVar) {
        boolean z = true;
        if (this.ˏ) {
            if (bVar.ॱ() < this.ˊ.ˊ()) {
                return !bVar.ˎ((View) bVar.ॱ.get(bVar.ॱ.size() + -1)).ˊ;
            }
        } else if (bVar.ˊ() > this.ˊ.ˏ()) {
            if (bVar.ˎ((View) bVar.ॱ.get(0)).ˊ) {
                z = false;
            }
            return z;
        }
        return false;
    }

    public void ॱ(int i) {
        ˎ(null);
        if (i != this.ॱॱ) {
            ᐝ();
            this.ॱॱ = i;
            this.ˊॱ = new BitSet(this.ॱॱ);
            this.ˎ = new b[this.ॱॱ];
            for (int i2 = 0; i2 < this.ॱॱ; i2++) {
                this.ˎ[i2] = new b(this, i2);
            }
            ॱˋ();
        }
    }

    public void ˊ(int i) {
        if (i == 0 || i == 1) {
            ˎ(null);
            if (i != this.ᐝ) {
                this.ᐝ = i;
                mq mqVar = this.ˊ;
                this.ˊ = this.ॱ;
                this.ॱ = mqVar;
                ॱˋ();
                return;
            }
            return;
        }
        throw new IllegalArgumentException("invalid orientation.");
    }

    public void ˎ(boolean z) {
        ˎ(null);
        if (!(this.ˋˊ == null || this.ˋˊ.ᐝ == z)) {
            this.ˋˊ.ᐝ = z;
        }
        this.ˋ = z;
        ॱˋ();
    }

    public void ˎ(String str) {
        if (this.ˋˊ == null) {
            super.ˎ(str);
        }
    }

    public void ᐝ() {
        this.ʽ.ˏ();
        ॱˋ();
    }

    private void ॱʼ() {
        boolean z = true;
        if (this.ᐝ == 1 || !ʽ()) {
            this.ˏ = this.ˋ;
            return;
        }
        if (this.ˋ) {
            z = false;
        }
        this.ˏ = z;
    }

    boolean ʽ() {
        return ʽॱ() == 1;
    }

    public void ॱ(Rect rect, int i, int i2) {
        int ˋᐝ = ˋᐝ() + ˊˊ();
        int ˋˋ = ˋˋ() + ˍ();
        if (this.ᐝ == 1) {
            ˋˋ = ˎ(i2, ˋˋ + rect.height(), ˏˎ());
            ˋᐝ = ˎ(i, ˋᐝ + (this.ˏॱ * this.ॱॱ), ͺॱ());
        } else {
            ˋᐝ = ˎ(i, ˋᐝ + rect.width(), ͺॱ());
            ˋˋ = ˎ(i2, ˋˋ + (this.ˏॱ * this.ॱॱ), ˏˎ());
        }
        ʻ(ˋᐝ, ˋˋ);
    }

    public void ˋ(o oVar, t tVar) {
        ˊ(oVar, tVar, true);
    }

    private void ˊ(o oVar, t tVar, boolean z) {
        d dVar = this.ˊᐝ;
        if (!(this.ˋˊ == null && this.ʻ == -1) && tVar.ˏ() == 0) {
            ˏ(oVar);
            dVar.ˎ();
            return;
        }
        boolean z2 = (dVar.ॱ && this.ʻ == -1 && this.ˋˊ == null) ? false : true;
        if (z2) {
            dVar.ˎ();
            if (this.ˋˊ != null) {
                ˋ(dVar);
            } else {
                ॱʼ();
                dVar.ˎ = this.ˏ;
            }
            ˊ(tVar, dVar);
            dVar.ॱ = true;
        }
        if (this.ˋˊ == null && this.ʻ == -1 && !(dVar.ˎ == this.ॱˊ && ʽ() == this.ˉ)) {
            this.ʽ.ˏ();
            dVar.ˊ = true;
        }
        if (ˈ() > 0 && (this.ˋˊ == null || this.ˋˊ.ॱ < 1)) {
            int i;
            if (dVar.ˊ) {
                for (i = 0; i < this.ॱॱ; i++) {
                    this.ˎ[i].ˎ();
                    if (dVar.ˋ != Integer.MIN_VALUE) {
                        this.ˎ[i].ˋ(dVar.ˋ);
                    }
                }
            } else if (z2 || this.ˊᐝ.ʽ == null) {
                for (i = 0; i < this.ॱॱ; i++) {
                    this.ˎ[i].ˊ(this.ˏ, dVar.ˋ);
                }
                this.ˊᐝ.ॱ(this.ˎ);
            } else {
                for (i = 0; i < this.ॱॱ; i++) {
                    b bVar = this.ˎ[i];
                    bVar.ˎ();
                    bVar.ˋ(this.ˊᐝ.ʽ[i]);
                }
            }
        }
        ˎ(oVar);
        this.ͺ.ˋ = false;
        this.ˋᐝ = false;
        ʽ(this.ॱ.ʻ());
        ˏ(dVar.ˏ, tVar);
        if (dVar.ˎ) {
            ˏॱ(-1);
            ॱ(oVar, this.ͺ, tVar);
            ˏॱ(1);
            this.ͺ.ˎ = dVar.ˏ + this.ͺ.ॱ;
            ॱ(oVar, this.ͺ, tVar);
        } else {
            ˏॱ(1);
            ॱ(oVar, this.ͺ, tVar);
            ˏॱ(-1);
            this.ͺ.ˎ = dVar.ˏ + this.ͺ.ॱ;
            ॱ(oVar, this.ͺ, tVar);
        }
        ॱʽ();
        if (ˈ() > 0) {
            if (this.ˏ) {
                ˎ(oVar, tVar, true);
                ॱ(oVar, tVar, false);
            } else {
                ॱ(oVar, tVar, true);
                ˎ(oVar, tVar, false);
            }
        }
        if (z && !tVar.ˋ()) {
            if (this.ˋॱ == 0 || ˈ() <= 0 || (!this.ˋᐝ && ॱॱ() == null)) {
                z2 = false;
            } else {
                z2 = true;
            }
            if (z2) {
                ˎ(this.ˎˎ);
                if (ˎ()) {
                    z2 = true;
                    if (tVar.ˋ()) {
                        this.ˊᐝ.ˎ();
                    }
                    this.ॱˊ = dVar.ˎ;
                    this.ˉ = ʽ();
                    if (z2) {
                        this.ˊᐝ.ˎ();
                        ˊ(oVar, tVar, false);
                    }
                }
            }
        }
        z2 = false;
        if (tVar.ˋ()) {
            this.ˊᐝ.ˎ();
        }
        this.ॱˊ = dVar.ˎ;
        this.ˉ = ʽ();
        if (z2) {
            this.ˊᐝ.ˎ();
            ˊ(oVar, tVar, false);
        }
    }

    public void ˋ(t tVar) {
        super.ˋ(tVar);
        this.ʻ = -1;
        this.ʼ = Integer.MIN_VALUE;
        this.ˋˊ = null;
        this.ˊᐝ.ˎ();
    }

    private void ॱʽ() {
        if (this.ॱ.ॱॱ() != 1073741824) {
            float f = 0.0f;
            int ˈ = ˈ();
            int i = 0;
            while (i < ˈ) {
                float f2;
                View ᐝ = ᐝ(i);
                float ˊ = (float) this.ॱ.ˊ(ᐝ);
                if (ˊ < f) {
                    f2 = f;
                } else {
                    if (((LayoutParams) ᐝ.getLayoutParams()).ˏ()) {
                        f2 = (1.0f * ˊ) / ((float) this.ॱॱ);
                    } else {
                        f2 = ˊ;
                    }
                    f2 = Math.max(f, f2);
                }
                i++;
                f = f2;
            }
            i = this.ˏॱ;
            int round = Math.round(((float) this.ॱॱ) * f);
            if (this.ॱ.ॱॱ() == Integer.MIN_VALUE) {
                round = Math.min(round, this.ॱ.ʻ());
            }
            ʽ(round);
            if (this.ˏॱ != i) {
                for (int i2 = 0; i2 < ˈ; i2++) {
                    View ᐝ2 = ᐝ(i2);
                    LayoutParams layoutParams = (LayoutParams) ᐝ2.getLayoutParams();
                    if (!layoutParams.ˊ) {
                        if (ʽ() && this.ᐝ == 1) {
                            ᐝ2.offsetLeftAndRight(((-((this.ॱॱ - 1) - layoutParams.ॱ.ˏ)) * this.ˏॱ) - ((-((this.ॱॱ - 1) - layoutParams.ॱ.ˏ)) * i));
                        } else {
                            int i3 = layoutParams.ॱ.ˏ * this.ˏॱ;
                            round = layoutParams.ॱ.ˏ * i;
                            if (this.ᐝ == 1) {
                                ᐝ2.offsetLeftAndRight(i3 - round);
                            } else {
                                ᐝ2.offsetTopAndBottom(i3 - round);
                            }
                        }
                    }
                }
            }
        }
    }

    private void ˋ(d dVar) {
        if (this.ˋˊ.ॱ > 0) {
            if (this.ˋˊ.ॱ == this.ॱॱ) {
                for (int i = 0; i < this.ॱॱ; i++) {
                    this.ˎ[i].ˎ();
                    int i2 = this.ˋˊ.ˏ[i];
                    if (i2 != Integer.MIN_VALUE) {
                        if (this.ˋˊ.ʻ) {
                            i2 += this.ˊ.ˊ();
                        } else {
                            i2 += this.ˊ.ˏ();
                        }
                    }
                    this.ˎ[i].ˋ(i2);
                }
            } else {
                this.ˋˊ.ˎ();
                this.ˋˊ.ˊ = this.ˋˊ.ˎ;
            }
        }
        this.ˉ = this.ˋˊ.ॱॱ;
        ˎ(this.ˋˊ.ᐝ);
        ॱʼ();
        if (this.ˋˊ.ˊ != -1) {
            this.ʻ = this.ˋˊ.ˊ;
            dVar.ˎ = this.ˋˊ.ʻ;
        } else {
            dVar.ˎ = this.ˏ;
        }
        if (this.ˋˊ.ˋ > 1) {
            this.ʽ.ˋ = this.ˋˊ.ʽ;
            this.ʽ.ˎ = this.ˋˊ.ʼ;
        }
    }

    void ˊ(t tVar, d dVar) {
        if (!ˎ(tVar, dVar) && !ˏ(tVar, dVar)) {
            dVar.ˊ();
            dVar.ˏ = 0;
        }
    }

    private boolean ˏ(t tVar, d dVar) {
        int ʽॱ;
        if (this.ॱˊ) {
            ʽॱ = ʽॱ(tVar.ˏ());
        } else {
            ʽॱ = ʾ(tVar.ˏ());
        }
        dVar.ˏ = ʽॱ;
        dVar.ˋ = Integer.MIN_VALUE;
        return true;
    }

    boolean ˎ(t tVar, d dVar) {
        boolean z = false;
        if (tVar.ˋ() || this.ʻ == -1) {
            return false;
        }
        if (this.ʻ < 0 || this.ʻ >= tVar.ˏ()) {
            this.ʻ = -1;
            this.ʼ = Integer.MIN_VALUE;
            return false;
        } else if (this.ˋˊ == null || this.ˋˊ.ˊ == -1 || this.ˋˊ.ॱ < 1) {
            View ˋ = ˋ(this.ʻ);
            if (ˋ != null) {
                int ˋॱ;
                if (this.ˏ) {
                    ˋॱ = ˋॱ();
                } else {
                    ˋॱ = ʻॱ();
                }
                dVar.ˏ = ˋॱ;
                if (this.ʼ != Integer.MIN_VALUE) {
                    if (dVar.ˎ) {
                        dVar.ˋ = (this.ˊ.ˊ() - this.ʼ) - this.ˊ.ॱ(ˋ);
                        return true;
                    }
                    dVar.ˋ = (this.ˊ.ˏ() + this.ʼ) - this.ˊ.ˋ(ˋ);
                    return true;
                } else if (this.ˊ.ˊ(ˋ) > this.ˊ.ʻ()) {
                    if (dVar.ˎ) {
                        ˋॱ = this.ˊ.ˊ();
                    } else {
                        ˋॱ = this.ˊ.ˏ();
                    }
                    dVar.ˋ = ˋॱ;
                    return true;
                } else {
                    ˋॱ = this.ˊ.ˋ(ˋ) - this.ˊ.ˏ();
                    if (ˋॱ < 0) {
                        dVar.ˋ = -ˋॱ;
                        return true;
                    }
                    ˋॱ = this.ˊ.ˊ() - this.ˊ.ॱ(ˋ);
                    if (ˋॱ < 0) {
                        dVar.ˋ = ˋॱ;
                        return true;
                    }
                    dVar.ˋ = Integer.MIN_VALUE;
                    return true;
                }
            }
            dVar.ˏ = this.ʻ;
            if (this.ʼ == Integer.MIN_VALUE) {
                if (ʿ(dVar.ˏ) == 1) {
                    z = true;
                }
                dVar.ˎ = z;
                dVar.ˊ();
            } else {
                dVar.ˎ(this.ʼ);
            }
            dVar.ˊ = true;
            return true;
        } else {
            dVar.ˋ = Integer.MIN_VALUE;
            dVar.ˏ = this.ʻ;
            return true;
        }
    }

    void ʽ(int i) {
        this.ˏॱ = i / this.ॱॱ;
        this.ˊˊ = MeasureSpec.makeMeasureSpec(i, this.ॱ.ॱॱ());
    }

    public boolean ˏ() {
        return this.ˋˊ == null;
    }

    public int ॱ(t tVar) {
        return ˏ(tVar);
    }

    private int ˏ(t tVar) {
        boolean z = true;
        if (ˈ() == 0) {
            return 0;
        }
        mq mqVar = this.ˊ;
        View ˏ = ˏ(!this.ˍ);
        if (this.ˍ) {
            z = false;
        }
        return mv.ˋ(tVar, mqVar, ˏ, ˋ(z), this, this.ˍ, this.ˏ);
    }

    public int ˊ(t tVar) {
        return ˏ(tVar);
    }

    public int ˎ(t tVar) {
        return ᐝ(tVar);
    }

    private int ᐝ(t tVar) {
        boolean z = true;
        if (ˈ() == 0) {
            return 0;
        }
        mq mqVar = this.ˊ;
        View ˏ = ˏ(!this.ˍ);
        if (this.ˍ) {
            z = false;
        }
        return mv.ॱ(tVar, mqVar, ˏ, ˋ(z), this, this.ˍ);
    }

    public int ʽ(t tVar) {
        return ᐝ(tVar);
    }

    public int ʼ(t tVar) {
        return ॱॱ(tVar);
    }

    private int ॱॱ(t tVar) {
        boolean z = true;
        if (ˈ() == 0) {
            return 0;
        }
        mq mqVar = this.ˊ;
        View ˏ = ˏ(!this.ˍ);
        if (this.ˍ) {
            z = false;
        }
        return mv.ˎ(tVar, mqVar, ˏ, ˋ(z), this, this.ˍ);
    }

    public int ʻ(t tVar) {
        return ॱॱ(tVar);
    }

    private void ॱ(View view, LayoutParams layoutParams, boolean z) {
        if (layoutParams.ˊ) {
            if (this.ᐝ == 1) {
                ˋ(view, this.ˊˊ, ˋ(ˉ(), ˊᐝ(), ˋˋ() + ˍ(), layoutParams.height, true), z);
            } else {
                ˋ(view, ˋ(ˋˊ(), ˊˋ(), ˊˊ() + ˋᐝ(), layoutParams.width, true), this.ˊˊ, z);
            }
        } else if (this.ᐝ == 1) {
            ˋ(view, ˋ(this.ˏॱ, ˊˋ(), 0, layoutParams.width, false), ˋ(ˉ(), ˊᐝ(), ˋˋ() + ˍ(), layoutParams.height, true), z);
        } else {
            ˋ(view, ˋ(ˋˊ(), ˊˋ(), ˊˊ() + ˋᐝ(), layoutParams.width, true), ˋ(this.ˏॱ, ˊᐝ(), 0, layoutParams.height, false), z);
        }
    }

    private void ˋ(View view, int i, int i2, boolean z) {
        boolean ˎ;
        ˊ(view, this.ˊˋ);
        LayoutParams layoutParams = (LayoutParams) view.getLayoutParams();
        int ॱ = ॱ(i, layoutParams.leftMargin + this.ˊˋ.left, layoutParams.rightMargin + this.ˊˋ.right);
        int ॱ2 = ॱ(i2, layoutParams.topMargin + this.ˊˋ.top, layoutParams.bottomMargin + this.ˊˋ.bottom);
        if (z) {
            ˎ = ˎ(view, ॱ, ॱ2, layoutParams);
        } else {
            ˎ = ॱ(view, ॱ, ॱ2, layoutParams);
        }
        if (ˎ) {
            view.measure(ॱ, ॱ2);
        }
    }

    private int ॱ(int i, int i2, int i3) {
        if (i2 == 0 && i3 == 0) {
            return i;
        }
        int mode = MeasureSpec.getMode(i);
        if (mode == Integer.MIN_VALUE || mode == 1073741824) {
            return MeasureSpec.makeMeasureSpec(Math.max(0, (MeasureSpec.getSize(i) - i2) - i3), mode);
        }
        return i;
    }

    public void ॱ(Parcelable parcelable) {
        if (parcelable instanceof SavedState) {
            this.ˋˊ = (SavedState) parcelable;
            ॱˋ();
        }
    }

    public Parcelable ˊ() {
        if (this.ˋˊ != null) {
            return new SavedState(this.ˋˊ);
        }
        SavedState savedState = new SavedState();
        savedState.ᐝ = this.ˋ;
        savedState.ʻ = this.ॱˊ;
        savedState.ॱॱ = this.ˉ;
        if (this.ʽ == null || this.ʽ.ˋ == null) {
            savedState.ˋ = 0;
        } else {
            savedState.ʽ = this.ʽ.ˋ;
            savedState.ˋ = savedState.ʽ.length;
            savedState.ʼ = this.ʽ.ˎ;
        }
        if (ˈ() > 0) {
            int ˋॱ;
            if (this.ॱˊ) {
                ˋॱ = ˋॱ();
            } else {
                ˋॱ = ʻॱ();
            }
            savedState.ˊ = ˋॱ;
            savedState.ˎ = ˊॱ();
            savedState.ॱ = this.ॱॱ;
            savedState.ˏ = new int[this.ॱॱ];
            for (ˋॱ = 0; ˋॱ < this.ॱॱ; ˋॱ++) {
                int ˊ;
                if (this.ॱˊ) {
                    ˊ = this.ˎ[ˋॱ].ˊ(Integer.MIN_VALUE);
                    if (ˊ != Integer.MIN_VALUE) {
                        ˊ -= this.ˊ.ˊ();
                    }
                } else {
                    ˊ = this.ˎ[ˋॱ].ˏ(Integer.MIN_VALUE);
                    if (ˊ != Integer.MIN_VALUE) {
                        ˊ -= this.ˊ.ˏ();
                    }
                }
                savedState.ˏ[ˋॱ] = ˊ;
            }
        } else {
            savedState.ˊ = -1;
            savedState.ˎ = -1;
            savedState.ॱ = 0;
        }
        return savedState;
    }

    public void ˊ(o oVar, t tVar, View view, in inVar) {
        android.view.ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
        if (layoutParams instanceof LayoutParams) {
            LayoutParams layoutParams2 = (LayoutParams) layoutParams;
            if (this.ᐝ == 0) {
                inVar.ˋ(in$e.ॱ(layoutParams2.ˊ(), layoutParams2.ˊ ? this.ॱॱ : 1, -1, -1, layoutParams2.ˊ, false));
                return;
            } else {
                inVar.ˋ(in$e.ॱ(-1, -1, layoutParams2.ˊ(), layoutParams2.ˊ ? this.ॱॱ : 1, layoutParams2.ˊ, false));
                return;
            }
        }
        super.ˏ(view, inVar);
    }

    public void ˊ(AccessibilityEvent accessibilityEvent) {
        super.ˊ(accessibilityEvent);
        if (ˈ() > 0) {
            View ˏ = ˏ(false);
            View ˋ = ˋ(false);
            if (ˏ != null && ˋ != null) {
                int ˎ = ˎ(ˏ);
                int ˎ2 = ˎ(ˋ);
                if (ˎ < ˎ2) {
                    accessibilityEvent.setFromIndex(ˎ);
                    accessibilityEvent.setToIndex(ˎ2);
                    return;
                }
                accessibilityEvent.setFromIndex(ˎ2);
                accessibilityEvent.setToIndex(ˎ);
            }
        }
    }

    int ˊॱ() {
        View ˋ;
        if (this.ˏ) {
            ˋ = ˋ(true);
        } else {
            ˋ = ˏ(true);
        }
        return ˋ == null ? -1 : ˎ(ˋ);
    }

    public int ˎ(o oVar, t tVar) {
        if (this.ᐝ == 0) {
            return this.ॱॱ;
        }
        return super.ˎ(oVar, tVar);
    }

    public int ˊ(o oVar, t tVar) {
        if (this.ᐝ == 1) {
            return this.ॱॱ;
        }
        return super.ˊ(oVar, tVar);
    }

    View ˏ(boolean z) {
        int ˏ = this.ˊ.ˏ();
        int ˊ = this.ˊ.ˊ();
        int ˈ = ˈ();
        View view = null;
        for (int i = 0; i < ˈ; i++) {
            View ᐝ = ᐝ(i);
            int ˋ = this.ˊ.ˋ(ᐝ);
            if (this.ˊ.ॱ(ᐝ) > ˏ && ˋ < ˊ) {
                if (ˋ >= ˏ || !z) {
                    return ᐝ;
                }
                if (view == null) {
                    view = ᐝ;
                }
            }
        }
        return view;
    }

    View ˋ(boolean z) {
        int ˏ = this.ˊ.ˏ();
        int ˊ = this.ˊ.ˊ();
        View view = null;
        for (int ˈ = ˈ() - 1; ˈ >= 0; ˈ--) {
            View ᐝ = ᐝ(ˈ);
            int ˋ = this.ˊ.ˋ(ᐝ);
            int ॱ = this.ˊ.ॱ(ᐝ);
            if (ॱ > ˏ && ˋ < ˊ) {
                if (ॱ <= ˊ || !z) {
                    return ᐝ;
                }
                if (view == null) {
                    view = ᐝ;
                }
            }
        }
        return view;
    }

    private void ˎ(o oVar, t tVar, boolean z) {
        int ʻॱ = ʻॱ(Integer.MIN_VALUE);
        if (ʻॱ != Integer.MIN_VALUE) {
            ʻॱ = this.ˊ.ˊ() - ʻॱ;
            if (ʻॱ > 0) {
                ʻॱ -= -ˋ(-ʻॱ, oVar, tVar);
                if (z && ʻॱ > 0) {
                    this.ˊ.ˋ(ʻॱ);
                }
            }
        }
    }

    private void ॱ(o oVar, t tVar, boolean z) {
        int ॱᐝ = ॱᐝ(ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED);
        if (ॱᐝ != ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED) {
            ॱᐝ -= this.ˊ.ˏ();
            if (ॱᐝ > 0) {
                ॱᐝ -= ˋ(ॱᐝ, oVar, tVar);
                if (z && ॱᐝ > 0) {
                    this.ˊ.ˋ(-ॱᐝ);
                }
            }
        }
    }

    private void ˏ(int i, t tVar) {
        int ˊ;
        int i2;
        ml mlVar;
        boolean z = false;
        this.ͺ.ˊ = 0;
        this.ͺ.ˎ = i;
        if (ʾ()) {
            ˊ = tVar.ˊ();
            if (ˊ != -1) {
                if (this.ˏ == (ˊ < i)) {
                    ˊ = this.ˊ.ʻ();
                    i2 = 0;
                } else {
                    i2 = this.ˊ.ʻ();
                    ˊ = 0;
                }
                if (ʿ()) {
                    this.ͺ.ॱॱ = ˊ + this.ˊ.ॱ();
                    this.ͺ.ʽ = -i2;
                } else {
                    this.ͺ.ʽ = this.ˊ.ˏ() - i2;
                    this.ͺ.ॱॱ = ˊ + this.ˊ.ˊ();
                }
                this.ͺ.ʼ = false;
                this.ͺ.ˋ = true;
                mlVar = this.ͺ;
                if (this.ˊ.ॱॱ() == 0 && this.ˊ.ॱ() == 0) {
                    z = true;
                }
                mlVar.ᐝ = z;
            }
        }
        ˊ = 0;
        i2 = 0;
        if (ʿ()) {
            this.ͺ.ॱॱ = ˊ + this.ˊ.ॱ();
            this.ͺ.ʽ = -i2;
        } else {
            this.ͺ.ʽ = this.ˊ.ˏ() - i2;
            this.ͺ.ॱॱ = ˊ + this.ˊ.ˊ();
        }
        this.ͺ.ʼ = false;
        this.ͺ.ˋ = true;
        mlVar = this.ͺ;
        z = true;
        mlVar.ᐝ = z;
    }

    private void ˏॱ(int i) {
        int i2 = 1;
        this.ͺ.ˏ = i;
        ml mlVar = this.ͺ;
        if (this.ˏ != (i == -1)) {
            i2 = -1;
        }
        mlVar.ॱ = i2;
    }

    public void ʻ(int i) {
        super.ʻ(i);
        for (int i2 = 0; i2 < this.ॱॱ; i2++) {
            this.ˎ[i2].ॱ(i);
        }
    }

    public void ͺ(int i) {
        super.ͺ(i);
        for (int i2 = 0; i2 < this.ॱॱ; i2++) {
            this.ˎ[i2].ॱ(i);
        }
    }

    public void ˊ(RecyclerView recyclerView, int i, int i2) {
        ˋ(i, i2, 2);
    }

    public void ॱ(RecyclerView recyclerView, int i, int i2) {
        ˋ(i, i2, 1);
    }

    public void ˎ(RecyclerView recyclerView) {
        this.ʽ.ˏ();
        ॱˋ();
    }

    public void ˏ(RecyclerView recyclerView, int i, int i2, int i3) {
        ˋ(i, i2, 8);
    }

    public void ˋ(RecyclerView recyclerView, int i, int i2, Object obj) {
        ˋ(i, i2, 4);
    }

    private void ˋ(int i, int i2, int i3) {
        int i4;
        int i5;
        int ˋॱ = this.ˏ ? ˋॱ() : ʻॱ();
        if (i3 != 8) {
            i4 = i + i2;
            i5 = i;
        } else if (i < i2) {
            i4 = i2 + 1;
            i5 = i;
        } else {
            i4 = i + 1;
            i5 = i2;
        }
        this.ʽ.ॱ(i5);
        switch (i3) {
            case 1:
                this.ʽ.ˏ(i, i2);
                break;
            case 2:
                this.ʽ.ॱ(i, i2);
                break;
            case 8:
                this.ʽ.ॱ(i, 1);
                this.ʽ.ˏ(i2, 1);
                break;
        }
        if (i4 > ˋॱ) {
            if (i5 <= (this.ˏ ? ʻॱ() : ˋॱ())) {
                ॱˋ();
            }
        }
    }

    private int ॱ(o oVar, ml mlVar, t tVar) {
        int i;
        int ˊ;
        int ʻॱ;
        this.ˊॱ.set(0, this.ॱॱ, true);
        if (this.ͺ.ᐝ) {
            i = mlVar.ˏ == 1 ? ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED : Integer.MIN_VALUE;
        } else if (mlVar.ˏ == 1) {
            i = mlVar.ॱॱ + mlVar.ˊ;
        } else {
            i = mlVar.ʽ - mlVar.ˊ;
        }
        ˎ(mlVar.ˏ, i);
        if (this.ˏ) {
            ˊ = this.ˊ.ˊ();
        } else {
            ˊ = this.ˊ.ˏ();
        }
        Object obj = null;
        while (mlVar.ˏ(tVar) && (this.ͺ.ᐝ || !this.ˊॱ.isEmpty())) {
            b bVar;
            int ˊ2;
            int ˊ3;
            View ˎ = mlVar.ˎ(oVar);
            LayoutParams layoutParams = (LayoutParams) ˎ.getLayoutParams();
            int ʻ = layoutParams.ʻ();
            int ˏ = this.ʽ.ˏ(ʻ);
            Object obj2 = ˏ == -1 ? 1 : null;
            if (obj2 != null) {
                b ˋ = layoutParams.ˊ ? this.ˎ[0] : ˋ(mlVar);
                this.ʽ.ॱ(ʻ, ˋ);
                bVar = ˋ;
            } else {
                bVar = this.ˎ[ˏ];
            }
            layoutParams.ॱ = bVar;
            if (mlVar.ˏ == 1) {
                ˊ(ˎ);
            } else {
                ˊ(ˎ, 0);
            }
            ॱ(ˎ, layoutParams, false);
            if (mlVar.ˏ == 1) {
                if (layoutParams.ˊ) {
                    ʻॱ = ʻॱ(ˊ);
                } else {
                    ʻॱ = bVar.ˊ(ˊ);
                }
                ˊ2 = ʻॱ + this.ˊ.ˊ(ˎ);
                if (obj2 == null || !layoutParams.ˊ) {
                    ˏ = ʻॱ;
                } else {
                    FullSpanItem ॱˊ = ॱˊ(ʻॱ);
                    ॱˊ.ˋ = -1;
                    ॱˊ.ˎ = ʻ;
                    this.ʽ.ˋ(ॱˊ);
                    ˏ = ʻॱ;
                }
            } else {
                if (layoutParams.ˊ) {
                    ʻॱ = ॱᐝ(ˊ);
                } else {
                    ʻॱ = bVar.ˏ(ˊ);
                }
                ˏ = ʻॱ - this.ˊ.ˊ(ˎ);
                if (obj2 != null && layoutParams.ˊ) {
                    FullSpanItem ˋॱ = ˋॱ(ʻॱ);
                    ˋॱ.ˋ = 1;
                    ˋॱ.ˎ = ʻ;
                    this.ʽ.ˋ(ˋॱ);
                }
                ˊ2 = ʻॱ;
            }
            if (layoutParams.ˊ && mlVar.ॱ == -1) {
                if (obj2 != null) {
                    this.ˋᐝ = true;
                } else {
                    obj = mlVar.ˏ == 1 ? !ͺ() ? 1 : null : !ॱˊ() ? 1 : null;
                    if (obj != null) {
                        FullSpanItem ᐝ = this.ʽ.ᐝ(ʻ);
                        if (ᐝ != null) {
                            ᐝ.ˊ = true;
                        }
                        this.ˋᐝ = true;
                    }
                }
            }
            ˏ(ˎ, layoutParams, mlVar);
            if (ʽ() && this.ᐝ == 1) {
                if (layoutParams.ˊ) {
                    ʻॱ = this.ॱ.ˊ();
                } else {
                    ʻॱ = this.ॱ.ˊ() - (((this.ॱॱ - 1) - bVar.ˏ) * this.ˏॱ);
                }
                ˊ3 = ʻॱ - this.ॱ.ˊ(ˎ);
                ʻ = ʻॱ;
            } else {
                if (layoutParams.ˊ) {
                    ʻॱ = this.ॱ.ˏ();
                } else {
                    ʻॱ = (bVar.ˏ * this.ˏॱ) + this.ॱ.ˏ();
                }
                ʻ = ʻॱ + this.ॱ.ˊ(ˎ);
                ˊ3 = ʻॱ;
            }
            if (this.ᐝ == 1) {
                ˋ(ˎ, ˊ3, ˏ, ʻ, ˊ2);
            } else {
                ˋ(ˎ, ˏ, ˊ3, ˊ2, ʻ);
            }
            if (layoutParams.ˊ) {
                ˎ(this.ͺ.ˏ, i);
            } else {
                ˊ(bVar, this.ͺ.ˏ, i);
            }
            ˋ(oVar, this.ͺ);
            if (this.ͺ.ʼ && ˎ.hasFocusable()) {
                if (layoutParams.ˊ) {
                    this.ˊॱ.clear();
                } else {
                    this.ˊॱ.set(bVar.ˏ, false);
                }
            }
            obj = 1;
        }
        if (obj == null) {
            ˋ(oVar, this.ͺ);
        }
        if (this.ͺ.ˏ == -1) {
            ʻॱ = this.ˊ.ˏ() - ॱᐝ(this.ˊ.ˏ());
        } else {
            ʻॱ = ʻॱ(this.ˊ.ˊ()) - this.ˊ.ˊ();
        }
        return ʻॱ > 0 ? Math.min(mlVar.ˊ, ʻॱ) : 0;
    }

    private FullSpanItem ॱˊ(int i) {
        FullSpanItem fullSpanItem = new FullSpanItem();
        fullSpanItem.ˏ = new int[this.ॱॱ];
        for (int i2 = 0; i2 < this.ॱॱ; i2++) {
            fullSpanItem.ˏ[i2] = i - this.ˎ[i2].ˊ(i);
        }
        return fullSpanItem;
    }

    private FullSpanItem ˋॱ(int i) {
        FullSpanItem fullSpanItem = new FullSpanItem();
        fullSpanItem.ˏ = new int[this.ॱॱ];
        for (int i2 = 0; i2 < this.ॱॱ; i2++) {
            fullSpanItem.ˏ[i2] = this.ˎ[i2].ˏ(i) - i;
        }
        return fullSpanItem;
    }

    private void ˏ(View view, LayoutParams layoutParams, ml mlVar) {
        if (mlVar.ˏ == 1) {
            if (layoutParams.ˊ) {
                ʻॱ(view);
            } else {
                layoutParams.ॱ.ˊ(view);
            }
        } else if (layoutParams.ˊ) {
            ॱˎ(view);
        } else {
            layoutParams.ॱ.ॱ(view);
        }
    }

    private void ˋ(o oVar, ml mlVar) {
        if (mlVar.ˋ && !mlVar.ᐝ) {
            if (mlVar.ˊ == 0) {
                if (mlVar.ˏ == -1) {
                    ॱ(oVar, mlVar.ॱॱ);
                } else {
                    ˏ(oVar, mlVar.ʽ);
                }
            } else if (mlVar.ˏ == -1) {
                r0 = mlVar.ʽ - ᐝॱ(mlVar.ʽ);
                if (r0 < 0) {
                    r0 = mlVar.ॱॱ;
                } else {
                    r0 = mlVar.ॱॱ - Math.min(r0, mlVar.ˊ);
                }
                ॱ(oVar, r0);
            } else {
                r0 = ॱˎ(mlVar.ॱॱ) - mlVar.ॱॱ;
                if (r0 < 0) {
                    r0 = mlVar.ʽ;
                } else {
                    r0 = Math.min(r0, mlVar.ˊ) + mlVar.ʽ;
                }
                ˏ(oVar, r0);
            }
        }
    }

    private void ʻॱ(View view) {
        for (int i = this.ॱॱ - 1; i >= 0; i--) {
            this.ˎ[i].ˊ(view);
        }
    }

    private void ॱˎ(View view) {
        for (int i = this.ॱॱ - 1; i >= 0; i--) {
            this.ˎ[i].ॱ(view);
        }
    }

    private void ˎ(int i, int i2) {
        for (int i3 = 0; i3 < this.ॱॱ; i3++) {
            if (!this.ˎ[i3].ॱ.isEmpty()) {
                ˊ(this.ˎ[i3], i, i2);
            }
        }
    }

    private void ˊ(b bVar, int i, int i2) {
        int ʽ = bVar.ʽ();
        if (i == -1) {
            if (ʽ + bVar.ˊ() <= i2) {
                this.ˊॱ.set(bVar.ˏ, false);
            }
        } else if (bVar.ॱ() - ʽ >= i2) {
            this.ˊॱ.set(bVar.ˏ, false);
        }
    }

    private int ᐝॱ(int i) {
        int ˏ = this.ˎ[0].ˏ(i);
        for (int i2 = 1; i2 < this.ॱॱ; i2++) {
            int ˏ2 = this.ˎ[i2].ˏ(i);
            if (ˏ2 > ˏ) {
                ˏ = ˏ2;
            }
        }
        return ˏ;
    }

    private int ॱᐝ(int i) {
        int ˏ = this.ˎ[0].ˏ(i);
        for (int i2 = 1; i2 < this.ॱॱ; i2++) {
            int ˏ2 = this.ˎ[i2].ˏ(i);
            if (ˏ2 < ˏ) {
                ˏ = ˏ2;
            }
        }
        return ˏ;
    }

    boolean ͺ() {
        int ˊ = this.ˎ[0].ˊ(Integer.MIN_VALUE);
        for (int i = 1; i < this.ॱॱ; i++) {
            if (this.ˎ[i].ˊ(Integer.MIN_VALUE) != ˊ) {
                return false;
            }
        }
        return true;
    }

    boolean ॱˊ() {
        int ˏ = this.ˎ[0].ˏ(Integer.MIN_VALUE);
        for (int i = 1; i < this.ॱॱ; i++) {
            if (this.ˎ[i].ˏ(Integer.MIN_VALUE) != ˏ) {
                return false;
            }
        }
        return true;
    }

    private int ʻॱ(int i) {
        int ˊ = this.ˎ[0].ˊ(i);
        for (int i2 = 1; i2 < this.ॱॱ; i2++) {
            int ˊ2 = this.ˎ[i2].ˊ(i);
            if (ˊ2 > ˊ) {
                ˊ = ˊ2;
            }
        }
        return ˊ;
    }

    private int ॱˎ(int i) {
        int ˊ = this.ˎ[0].ˊ(i);
        for (int i2 = 1; i2 < this.ॱॱ; i2++) {
            int ˊ2 = this.ˎ[i2].ˊ(i);
            if (ˊ2 < ˊ) {
                ˊ = ˊ2;
            }
        }
        return ˊ;
    }

    private void ˏ(o oVar, int i) {
        while (ˈ() > 0) {
            View ᐝ = ᐝ(0);
            if (this.ˊ.ॱ(ᐝ) <= i && this.ˊ.ˏ(ᐝ) <= i) {
                LayoutParams layoutParams = (LayoutParams) ᐝ.getLayoutParams();
                if (layoutParams.ˊ) {
                    int i2 = 0;
                    while (i2 < this.ॱॱ) {
                        if (this.ˎ[i2].ॱ.size() != 1) {
                            i2++;
                        } else {
                            return;
                        }
                    }
                    for (i2 = 0; i2 < this.ॱॱ; i2++) {
                        this.ˎ[i2].ᐝ();
                    }
                } else if (layoutParams.ॱ.ॱ.size() != 1) {
                    layoutParams.ॱ.ᐝ();
                } else {
                    return;
                }
                ˏ(ᐝ, oVar);
            } else {
                return;
            }
        }
    }

    private void ॱ(o oVar, int i) {
        int ˈ = ˈ() - 1;
        while (ˈ >= 0) {
            View ᐝ = ᐝ(ˈ);
            if (this.ˊ.ˋ(ᐝ) >= i && this.ˊ.ˎ(ᐝ) >= i) {
                LayoutParams layoutParams = (LayoutParams) ᐝ.getLayoutParams();
                if (layoutParams.ˊ) {
                    int i2 = 0;
                    while (i2 < this.ॱॱ) {
                        if (this.ˎ[i2].ॱ.size() != 1) {
                            i2++;
                        } else {
                            return;
                        }
                    }
                    for (i2 = 0; i2 < this.ॱॱ; i2++) {
                        this.ˎ[i2].ʻ();
                    }
                } else if (layoutParams.ॱ.ॱ.size() != 1) {
                    layoutParams.ॱ.ʻ();
                } else {
                    return;
                }
                ˏ(ᐝ, oVar);
                ˈ--;
            } else {
                return;
            }
        }
    }

    private boolean ॱˋ(int i) {
        if (this.ᐝ == 0) {
            boolean z;
            if (i == -1) {
                z = true;
            } else {
                z = false;
            }
            if (z != this.ˏ) {
                return true;
            }
            return false;
        }
        if (((i == -1) == this.ˏ) != ʽ()) {
            return false;
        }
        return true;
    }

    private b ˋ(ml mlVar) {
        int i;
        int i2;
        b bVar = null;
        int i3 = -1;
        if (ॱˋ(mlVar.ˏ)) {
            i = this.ॱॱ - 1;
            i2 = -1;
        } else {
            i = 0;
            i2 = this.ॱॱ;
            i3 = 1;
        }
        int ˏ;
        int i4;
        b bVar2;
        int ˊ;
        b bVar3;
        if (mlVar.ˏ == 1) {
            ˏ = this.ˊ.ˏ();
            i4 = i;
            i = Integer.MAX_VALUE;
            while (i4 != i2) {
                bVar2 = this.ˎ[i4];
                ˊ = bVar2.ˊ(ˏ);
                if (ˊ < i) {
                    bVar3 = bVar2;
                } else {
                    ˊ = i;
                    bVar3 = bVar;
                }
                i4 += i3;
                bVar = bVar3;
                i = ˊ;
            }
        } else {
            ˏ = this.ˊ.ˊ();
            i4 = i;
            i = Integer.MIN_VALUE;
            while (i4 != i2) {
                bVar2 = this.ˎ[i4];
                ˊ = bVar2.ˏ(ˏ);
                if (ˊ > i) {
                    bVar3 = bVar2;
                } else {
                    ˊ = i;
                    bVar3 = bVar;
                }
                i4 += i3;
                bVar = bVar3;
                i = ˊ;
            }
        }
        return bVar;
    }

    public boolean ʼ() {
        return this.ᐝ == 1;
    }

    public boolean ʻ() {
        return this.ᐝ == 0;
    }

    public int ˊ(int i, o oVar, t tVar) {
        return ˋ(i, oVar, tVar);
    }

    public int ˎ(int i, o oVar, t tVar) {
        return ˋ(i, oVar, tVar);
    }

    private int ʿ(int i) {
        int i2 = -1;
        if (ˈ() != 0) {
            if ((i < ʻॱ()) == this.ˏ) {
                i2 = 1;
            }
            return i2;
        } else if (this.ˏ) {
            return 1;
        } else {
            return -1;
        }
    }

    public PointF ˎ(int i) {
        int ʿ = ʿ(i);
        PointF pointF = new PointF();
        if (ʿ == 0) {
            return null;
        }
        if (this.ᐝ == 0) {
            pointF.x = (float) ʿ;
            pointF.y = 0.0f;
            return pointF;
        }
        pointF.x = 0.0f;
        pointF.y = (float) ʿ;
        return pointF;
    }

    public void ˏ(int i) {
        if (!(this.ˋˊ == null || this.ˋˊ.ˊ == i)) {
            this.ˋˊ.ˋ();
        }
        this.ʻ = i;
        this.ʼ = Integer.MIN_VALUE;
        ॱˋ();
    }

    @RestrictTo({androidx.annotation.RestrictTo.d.LIBRARY})
    public void ˊ(int i, int i2, t tVar, androidx.recyclerview.widget.RecyclerView.j.b bVar) {
        int i3 = 0;
        if (this.ᐝ != 0) {
            i = i2;
        }
        if (ˈ() != 0 && i != 0) {
            ॱ(i, tVar);
            if (this.ˌ == null || this.ˌ.length < this.ॱॱ) {
                this.ˌ = new int[this.ॱॱ];
            }
            int i4 = 0;
            for (int i5 = 0; i5 < this.ॱॱ; i5++) {
                int ˏ;
                if (this.ͺ.ॱ == -1) {
                    ˏ = this.ͺ.ʽ - this.ˎ[i5].ˏ(this.ͺ.ʽ);
                } else {
                    ˏ = this.ˎ[i5].ˊ(this.ͺ.ॱॱ) - this.ͺ.ॱॱ;
                }
                if (ˏ >= 0) {
                    this.ˌ[i4] = ˏ;
                    i4++;
                }
            }
            Arrays.sort(this.ˌ, 0, i4);
            while (i3 < i4 && this.ͺ.ˏ(tVar)) {
                bVar.ˎ(this.ͺ.ˎ, this.ˌ[i3]);
                ml mlVar = this.ͺ;
                mlVar.ˎ += this.ͺ.ॱ;
                i3++;
            }
        }
    }

    void ॱ(int i, t tVar) {
        int ˋॱ;
        int i2;
        if (i > 0) {
            ˋॱ = ˋॱ();
            i2 = 1;
        } else {
            i2 = -1;
            ˋॱ = ʻॱ();
        }
        this.ͺ.ˋ = true;
        ˏ(ˋॱ, tVar);
        ˏॱ(i2);
        this.ͺ.ˎ = this.ͺ.ॱ + ˋॱ;
        this.ͺ.ˊ = Math.abs(i);
    }

    int ˋ(int i, o oVar, t tVar) {
        if (ˈ() == 0 || i == 0) {
            return 0;
        }
        ॱ(i, tVar);
        int ॱ = ॱ(oVar, this.ͺ, tVar);
        if (this.ͺ.ˊ >= ॱ) {
            i = i < 0 ? -ॱ : ॱ;
        }
        this.ˊ.ˋ(-i);
        this.ॱˊ = this.ˏ;
        this.ͺ.ˊ = 0;
        ˋ(oVar, this.ͺ);
        return i;
    }

    int ˋॱ() {
        int ˈ = ˈ();
        return ˈ == 0 ? 0 : ˎ(ᐝ(ˈ - 1));
    }

    int ʻॱ() {
        if (ˈ() == 0) {
            return 0;
        }
        return ˎ(ᐝ(0));
    }

    private int ʾ(int i) {
        int ˈ = ˈ();
        for (int i2 = 0; i2 < ˈ; i2++) {
            int ˎ = ˎ(ᐝ(i2));
            if (ˎ >= 0 && ˎ < i) {
                return ˎ;
            }
        }
        return 0;
    }

    private int ʽॱ(int i) {
        for (int ˈ = ˈ() - 1; ˈ >= 0; ˈ--) {
            int ˎ = ˎ(ᐝ(ˈ));
            if (ˎ >= 0 && ˎ < i) {
                return ˎ;
            }
        }
        return 0;
    }

    public androidx.recyclerview.widget.RecyclerView.LayoutParams ॱ() {
        if (this.ᐝ == 0) {
            return new LayoutParams(-2, -1);
        }
        return new LayoutParams(-1, -2);
    }

    public androidx.recyclerview.widget.RecyclerView.LayoutParams ˏ(Context context, AttributeSet attributeSet) {
        return new LayoutParams(context, attributeSet);
    }

    public androidx.recyclerview.widget.RecyclerView.LayoutParams ˏ(android.view.ViewGroup.LayoutParams layoutParams) {
        if (layoutParams instanceof MarginLayoutParams) {
            return new LayoutParams((MarginLayoutParams) layoutParams);
        }
        return new LayoutParams(layoutParams);
    }

    public boolean ˏ(androidx.recyclerview.widget.RecyclerView.LayoutParams layoutParams) {
        return layoutParams instanceof LayoutParams;
    }

    @Nullable
    public View ˎ(View view, int i, o oVar, t tVar) {
        int i2 = 0;
        if (ˈ() == 0) {
            return null;
        }
        View ˏ = ˏ(view);
        if (ˏ == null) {
            return null;
        }
        ॱʼ();
        int ˈ = ˈ(i);
        if (ˈ == Integer.MIN_VALUE) {
            return null;
        }
        int ˋॱ;
        View ˊ;
        int i3;
        View ˋ;
        LayoutParams layoutParams = (LayoutParams) ˏ.getLayoutParams();
        boolean z = layoutParams.ˊ;
        b bVar = layoutParams.ॱ;
        if (ˈ == 1) {
            ˋॱ = ˋॱ();
        } else {
            ˋॱ = ʻॱ();
        }
        ˏ(ˋॱ, tVar);
        ˏॱ(ˈ);
        this.ͺ.ˎ = this.ͺ.ॱ + ˋॱ;
        this.ͺ.ˊ = (int) (0.33333334f * ((float) this.ˊ.ʻ()));
        this.ͺ.ʼ = true;
        this.ͺ.ˋ = false;
        ॱ(oVar, this.ͺ, tVar);
        this.ॱˊ = this.ˏ;
        if (!z) {
            ˊ = bVar.ˊ(ˋॱ, ˈ);
            if (!(ˊ == null || ˊ == ˏ)) {
                return ˊ;
            }
        }
        if (ॱˋ(ˈ)) {
            for (int i4 = this.ॱॱ - 1; i4 >= 0; i4--) {
                ˊ = this.ˎ[i4].ˊ(ˋॱ, ˈ);
                if (ˊ != null && ˊ != ˏ) {
                    return ˊ;
                }
            }
        } else {
            for (i3 = 0; i3 < this.ॱॱ; i3++) {
                View ˊ2 = this.ˎ[i3].ˊ(ˋॱ, ˈ);
                if (ˊ2 != null && ˊ2 != ˏ) {
                    return ˊ2;
                }
            }
        }
        boolean z2 = (!this.ˋ) == (ˈ == -1);
        if (!z) {
            if (z2) {
                ˋॱ = bVar.ʼ();
            } else {
                ˋॱ = bVar.ˋॱ();
            }
            ˋ = ˋ(ˋॱ);
            if (!(ˋ == null || ˋ == ˏ)) {
                return ˋ;
            }
        }
        if (ॱˋ(ˈ)) {
            for (i3 = this.ॱॱ - 1; i3 >= 0; i3--) {
                if (i3 != bVar.ˏ) {
                    if (z2) {
                        ˋॱ = this.ˎ[i3].ʼ();
                    } else {
                        ˋॱ = this.ˎ[i3].ˋॱ();
                    }
                    ˋ = ˋ(ˋॱ);
                    if (!(ˋ == null || ˋ == ˏ)) {
                        return ˋ;
                    }
                }
            }
        } else {
            while (i2 < this.ॱॱ) {
                if (z2) {
                    ˋॱ = this.ˎ[i2].ʼ();
                } else {
                    ˋॱ = this.ˎ[i2].ˋॱ();
                }
                ˋ = ˋ(ˋॱ);
                if (ˋ != null && ˋ != ˏ) {
                    return ˋ;
                }
                i2++;
            }
        }
        return null;
    }

    private int ˈ(int i) {
        int i2 = Integer.MIN_VALUE;
        int i3 = 1;
        switch (i) {
            case 1:
                if (this.ᐝ == 1 || !ʽ()) {
                    return -1;
                }
                return 1;
            case 2:
                if (this.ᐝ == 1) {
                    return 1;
                }
                if (ʽ()) {
                    return -1;
                }
                return 1;
            case 17:
                if (this.ᐝ != 0) {
                    return Integer.MIN_VALUE;
                }
                return -1;
            case 33:
                if (this.ᐝ != 1) {
                    return Integer.MIN_VALUE;
                }
                return -1;
            case fc.c.ꓸॱ /*66*/:
                if (this.ᐝ != 0) {
                    i3 = Integer.MIN_VALUE;
                }
                return i3;
            case 130:
                if (this.ᐝ == 1) {
                    i2 = 1;
                }
                return i2;
            default:
                return Integer.MIN_VALUE;
        }
    }
}
